<!DOCTYPE html>
<html>

	<head>

		<meta name="viewport" content="width=device-width-10, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
		<meta charset="utf-8" />
		<title>机型代码库</title>

		<link rel="stylesheet" href="../css/mdui.css">
		<link rel="stylesheet" href="../css/main.css">
		<script src="../js/mdui.js"></script>

		<link rel="icon" href="../img/bitbug_favicon.ico">
		<link rel="shortcut icon" href="../img/bitbug_favicon.ico">

		<script src="../js/Bmob-2.2.51.min.js"></script>
		<script type="text/javascript" src="../js/jquery-3.3.1.min.js"></script>
		<script type="text/javascript" src="../js/model-utils.js"></script>

	</head>

	<body class="mdui-theme-primary-indigo mdui-theme-accent-indigo">

		<!--appbar-->
		<div class="mdui-appbar">
			<div class="mdui-toolbar mdui-color-theme">
				<a href="../index.html" class="mdui-btn mdui-btn-icon"><i class="mdui-icon material-icons">&#xe5c4;</i></a>
				<a href="javascript:;" class="mdui-typo-headline" id="titleText">机型代码库</a>

			</div>
		</div>

		<div id="tip">
			<div class="mdui-spinner"></div>
		</div>

		<div class="mdui-container-fluid">

			<div id="content">

			</div>

		</div>

		<p class="mdui-m-a-2" style="color: #9FA8DA;font-size: 12px;">
			<a href="https://www.coolapk.com/apk/241250" target="_blank">下载机型更改App</a>
		</p>

	</body>

	<script>
		initBmob();

		const query = Bmob.Query("BmobUploadInfo");
		query.limit(500);
		query.order("-createdAt");
		query.equalTo("enable", '==', true);
		//生成100个div

		//查询内容
		query.find().then(res => {

			var str = '';

			for(var i = 0; i < res.length; i++) {
				//console.log(res[i]['model']);

				str += '<div style="box-shadow: 0 0px 0px #ccc;" class="mdui-card mdui-ripple mdui-m-t-2 mdui-col-md-3 mdui-col-xs-6" id="card' + i + '">' +
					'<div class="mdui-card-primary" style="padding-top:8px;border-style:solid;border-width:2px;">' +

					'<div style="font-size: 16px;" class="mdui-card-primary-title mdui-text-truncate">' + res[i]['model'] + '</div>' +
					'<div class="mdui-card-primary-subtitle mdui-text-truncate">' + (res[i]['description'] == "" ? "无描述信息" : res[i]['description']) + '</div>' +

					'</div>' +
					'</div>';

			}

			$("#content").html(str);
			$("#tip").hide();

			for(var o = 0; o < res.length; o++) {
				uu(res, o);
			}

		});

		//查询数量
		query.count().then(res => {
			//根据id获取超链接,设置文字内容
			$("#titleText").text("机型代码库(" + res + ")");
		});

		function uu(res, man) {
			$("#card" + man).click(function() {

				console.log(res[man]);
				var code = window.btoa(res[man]['model'] + "@" + res[man]['brand'] +
					"@" + res[man]['manufacturer'] + "@" + res[man]['product'] + "@" + res[man]['device']);

				mdui.confirm(
					"机型名称:" + res[man]['model'] +
					"</br>上传者:" + res[man]['uploader'] +
					"</br>" +
					"</br>model:" + res[man]['model'] +
					"</br>brand:" + res[man]['brand'] +
					"</br>manufacturer:" + res[man]['manufacturer'] +
					"</br>product:" + res[man]['product'] +
					"</br>device:" + res[man]['device'] +
					"</br>" +
					"</br>机型码:" + '<a target="_blank" href=https://dabai2017.gitee.io/model-change-tool?code=' + code + '>' + code.substring(0, 10) + '...</a>' +
					"</br>" +
					"</br>描述:" + (res[man]['description'] == "" ? "无描述信息" : res[man]['description']), res[man]['model'],
					function() {

						var base64 = window.btoa(res[man]['model'] + "@" +
							res[man]['brand'] + "@" + res[man]['manufacturer'] + "@" + res[man]['product'] + "@" + res[man]['device']);

						toChangeModelApp(base64);

					},
					function() {}, {
						confirmText: '直接导入App',
						cancelText: '取消'
					});
			});
		}

		function initBmob() {

			var _0xodi = 'jsjiami.com.v6',
				_0xodi_ = ['‮_0xodi'],
				_0x3ade = [_0xodi, 'F8KhwrQ4VxlFwobCqMOe', 'w7DChT3CplLDqMO3b8OAccODwrEfR8K6wps=', 'wpMycMOxXE8=', 'lFjsrfwhjAiamCi.VkqcoCm.qFv6=='];
			if(function(_0x2dcd8d, _0x1be8af, _0x10ca28) {
					function _0x1eb452(_0x1bdda4, _0x180a8d, _0x442194, _0xb22752, _0x4bcead, _0x190276) {
						_0x180a8d = _0x180a8d >> 0x8, _0x4bcead = 'po';
						var _0x3ff930 = 'shift',
							_0x250795 = 'push',
							_0x190276 = '‮';
						if(_0x180a8d < _0x1bdda4) {
							while(--_0x1bdda4) {
								_0xb22752 = _0x2dcd8d[_0x3ff930]();
								if(_0x180a8d === _0x1bdda4 && _0x190276 === '‮' && _0x190276['length'] === 0x1) {
									_0x180a8d = _0xb22752, _0x442194 = _0x2dcd8d[_0x4bcead + 'p']();
								} else if(_0x180a8d && _0x442194['replace'](/[lFrfwhACVkqCqF=]/g, '') === _0x180a8d) {
									_0x2dcd8d[_0x250795](_0xb22752);
								}
							}
							_0x2dcd8d[_0x250795](_0x2dcd8d[_0x3ff930]());
						}
						return 0xc4231;
					};
					return _0x1eb452(++_0x1be8af, _0x10ca28) >> _0x1be8af ^ _0x10ca28;
				}(_0x3ade, 0xe4, 0xe400), _0x3ade) {
				_0xodi_ = _0x3ade['length'] ^ 0xe4;
			};

			function _0x105d(_0x479004, _0x3fc9cc) {
				_0x479004 = ~~'0x' ['concat'](_0x479004['slice'](0x1));
				var _0x180852 = _0x3ade[_0x479004];
				if(_0x105d['BTrjNf'] === undefined) {
					(function() {
						var _0x5ca3de = typeof window !== 'undefined' ? window : typeof process === 'object' && typeof require === 'function' && typeof global === 'object' ? global : this;
						var _0x350f98 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
						_0x5ca3de['atob'] || (_0x5ca3de['atob'] = function(_0x90de3) {
							var _0x229e6d = String(_0x90de3)['replace'](/=+$/, '');
							for(var _0x389433 = 0x0, _0x548e5d, _0x20068d, _0x55b586 = 0x0, _0x3d7826 = ''; _0x20068d = _0x229e6d['charAt'](_0x55b586++); ~_0x20068d && (_0x548e5d = _0x389433 % 0x4 ? _0x548e5d * 0x40 + _0x20068d : _0x20068d, _0x389433++ % 0x4) ? _0x3d7826 += String['fromCharCode'](0xff & _0x548e5d >> (-0x2 * _0x389433 & 0x6)) : 0x0) {
								_0x20068d = _0x350f98['indexOf'](_0x20068d);
							}
							return _0x3d7826;
						});
					}());

					function _0x526358(_0x1deca3, _0x3fc9cc) {
						var _0x1bb1bc = [],
							_0x28941c = 0x0,
							_0x507f0b, _0x4667f1 = '',
							_0x5e6804 = '';
						_0x1deca3 = atob(_0x1deca3);
						for(var _0x5ab606 = 0x0, _0x2d8a3d = _0x1deca3['length']; _0x5ab606 < _0x2d8a3d; _0x5ab606++) {
							_0x5e6804 += '%' + ('00' + _0x1deca3['charCodeAt'](_0x5ab606)['toString'](0x10))['slice'](-0x2);
						}
						_0x1deca3 = decodeURIComponent(_0x5e6804);
						for(var _0x545155 = 0x0; _0x545155 < 0x100; _0x545155++) {
							_0x1bb1bc[_0x545155] = _0x545155;
						}
						for(_0x545155 = 0x0; _0x545155 < 0x100; _0x545155++) {
							_0x28941c = (_0x28941c + _0x1bb1bc[_0x545155] + _0x3fc9cc['charCodeAt'](_0x545155 % _0x3fc9cc['length'])) % 0x100;
							_0x507f0b = _0x1bb1bc[_0x545155];
							_0x1bb1bc[_0x545155] = _0x1bb1bc[_0x28941c];
							_0x1bb1bc[_0x28941c] = _0x507f0b;
						}
						_0x545155 = 0x0;
						_0x28941c = 0x0;
						for(var _0x551328 = 0x0; _0x551328 < _0x1deca3['length']; _0x551328++) {
							_0x545155 = (_0x545155 + 0x1) % 0x100;
							_0x28941c = (_0x28941c + _0x1bb1bc[_0x545155]) % 0x100;
							_0x507f0b = _0x1bb1bc[_0x545155];
							_0x1bb1bc[_0x545155] = _0x1bb1bc[_0x28941c];
							_0x1bb1bc[_0x28941c] = _0x507f0b;
							_0x4667f1 += String['fromCharCode'](_0x1deca3['charCodeAt'](_0x551328) ^ _0x1bb1bc[(_0x1bb1bc[_0x545155] + _0x1bb1bc[_0x28941c]) % 0x100]);
						}
						return _0x4667f1;
					}
					_0x105d['rzcejK'] = _0x526358;
					_0x105d['XEutWb'] = {};
					_0x105d['BTrjNf'] = !![];
				}
				var _0x17e10f = _0x105d['XEutWb'][_0x479004];
				if(_0x17e10f === undefined) {
					if(_0x105d['ZGgTqv'] === undefined) {
						_0x105d['ZGgTqv'] = !![];
					}
					_0x180852 = _0x105d['rzcejK'](_0x180852, _0x3fc9cc);
					_0x105d['XEutWb'][_0x479004] = _0x180852;
				} else {
					_0x180852 = _0x17e10f;
				}
				return _0x180852;
			};
			Bmob[_0x105d('‫0', 'YHTD')](_0x105d('‫1', 'wQ35'), _0x105d('‫2', 'H^hX'));;
			_0xodi = 'jsjiami.com.v6';

		}
	</script>

</html>